unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, RzEdit, RzButton, ExtCtrls, RzPanel, DB, DBAccess, Uni,
  UniProvider, SQLServerUniProvider, MemDS,JsonAndDB,superobject;

type
  TForm1 = class(TForm)
    Tool_1: TRzToolbar;
    Btnx_1: TRzToolButton;
    Btnx_2: TRzToolButton;
    Memo_1: TRzMemo;
    UniConnection1: TUniConnection;
    SQLServerUniProvider1: TSQLServerUniProvider;
    UniQuery1: TUniQuery;
    procedure Btnx_2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Btnx_2Click(Sender: TObject);
var
  SQLA:string;
  TMPA:UTF8String;
begin
  SQLA:='select top 10 * from tbl_staf';
  UniQuery1.SQL.Add(SQLA);
  UniQuery1.Open;

  //ShowMessageFmt('%D',[UniQuery1.RecordCount]);

  TMPA:=JsonAndDB.TJSONDB.ClientDataSetToJSON(UniQuery1);
  Memo_1.Lines.Add(TMPA);
end;

end.
